package com.example.administrator.coldlain.activity;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.TextView;

import com.example.administrator.coldlain.R;
import com.example.administrator.coldlain.db.VehicleDBHelper;

public class ResultActivity extends Activity {
    private TextView result;
    VehicleDBHelper dbHelper;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        dbHelper=new VehicleDBHelper(getApplication());
        initView();


    }
    private void initView() {
        result = (TextView) findViewById(R.id.result);
        Cursor cursor=dbHelper.getUser();
        String resulttxt="";
        while(cursor.moveToNext())
            resulttxt+=cursor.getString(1)+cursor.getString(2);
        result.setText(resulttxt);
//        Intent intent=getIntent();
//        Bundle b=intent.getBundleExtra("data");
//        result.setText(b.getString("username")+"\n"
//                +b.getString("password")+"\n"
//                +b.getString("ssex")+"\n"
//                +b.getString("hobby")+"\n"
//                +b.getString("marriaged")+"\n"
//                +b.getString("position")+"\n"
//        );
    }
}
